package com.oocl.euc.core.maintenance.service;
import com.oocl.euc.core.maintenance.model.SubCategory;
import com.oocl.euc.core.requestform.repository.SubCategoryRepository;
import com.oocl.euc.framework.base.persistence.IBaseRepository;
import com.oocl.euc.framework.base.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SubCategoryService extends BaseService<SubCategory, String> {

  @Autowired
  private SubCategoryRepository subCategoryRepository;

  @Override
  protected IBaseRepository<SubCategory, String> getRepository() {
    return subCategoryRepository;
  }

  public SubCategory findByCategoryIdAndSubCategoryId(String categoryId, String subcategoryId) {
    return subCategoryRepository.findByCategoryIdAndSubCategoryId(categoryId, subcategoryId);
  }
}
